.switch {
    position: relative;
    box-sizing: border-box;
    background: #333;
    border-radius: 6px;
    box-shadow: inset 0 1px 1px 1px rgba(0, 0, 0, 0.5), 0 1px 0 0 rgba(255, 255, 255, 0.1);
    width: 105px;
    height: 25px;
    padding: 1.5px;
}

.switch input[type="checkbox"] {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.switch input[type="checkbox"]+label {
    position: relative;
    display: block;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--silver-bg);
    border-radius: 3px;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease-in-out;
}

.switch input[type="checkbox"]+label:before {
    width: 2.5px;
    height: 2.5px;
    margin-left: 5px;
    content: "";
    display: inline-block;
    background: #fff;
    border-radius: 50%;
    vertical-align: middle;
    box-shadow: 0 0 5px 2px rgba(165, 15, 15, 0.9), 0 0 3px 1px rgba(165, 15, 15, 0.9);
    transition: all 0.5s ease-in-out;
}

.switch input[type="checkbox"]+label:after {
    content: "";
    display: inline-block;
    width: 0;
    height: 100%;
    vertical-align: middle;
}

.switch input[type="checkbox"]+label i {
    width: 1.5px;
    height: 12px;
    margin-top: -6px;
    margin-left: -0.75px;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 2px;
    background: var(--main-text-color);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.switch input[type="checkbox"]+label i:before,
.switch input[type="checkbox"]+label i:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 2px;
    background: var(--main-text-color);
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.3);
}

.switch input[type="checkbox"]+label i:before {
    left: -3.5px;
}

.switch input[type="checkbox"]+label i:after {
    left: 3.5px;
}

.switch input[type="checkbox"]:checked+label {
    left: 50%;
}

.switch input[type="checkbox"]:checked+label:before {
    box-shadow: 0 0 5px 2px rgba(15, 165, 70, 0.9), 0 0 3px 1px rgba(15, 165, 70, 0.9);
}

@media (max-width: 768px) {
    .switch {
        width: 70px;
        height: 17px;
        padding: 1px;
    }
    .switch input[type="checkbox"]+label:before {
        width: 1.67px;
        height: 1.67px;
        margin-left: 3.33px;
        margin-top: -9px;
    }
    .switch input[type="checkbox"]+label i {
        width: 1px;
        height: 8px;
        margin-top: -4px;
        margin-left: -0.5px;
    }
    .switch input[type="checkbox"]+label i:before {
        left: -2.33px;
    }
    .switch input[type="checkbox"]+label i:after {
        left: 2.33px;
    }
}